/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aiaudio.database.tables;

import aiaudio.database.Family;
import aiaudio.database.qualifiers.LongQualifier;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;

/**
 *
 * @author nastya
 */
public class TimeMetricsTable extends TableStructure {

    private static final Family VALUE = new Family("v");
    private static final Family PARAMS = new Family("p");
    private static final LongQualifier DURATION = new LongQualifier("duration");

    public static void addTime(Put put, long value) {
        TableStructure.addData(put, VALUE, DURATION, value);
    }

    public static void addParameter(Put put, String paramName, byte[] value) {
        put.add(PARAMS.getNameAsBytes(), Bytes.toBytes(paramName), value);
    }

    @Override
    public Family[] getAllFamilies() {
        return new Family[]{VALUE, PARAMS};
    }
}
